import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import fire from '@dfeidao/atom-web/msg/fire';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p001 from './p001';
import p002 from './p002';
export default async function a001(fd: IFeidaoAiBrowserComponent, no: string) {
	const d = fd.data.node.querySelector<HTMLDivElement>('[data-name="update"]');
	set_node_cls(d, 'display-n', false);
	fire('zj-000001', 'a002');

	fire('zj-000002', 'a003');
	const train_number = no;
	console.log('no:' + train_number);
	const res = await nodejs('train-plan/zj-000004/s002', {
		train_number
	});
	console.log(res);

	render(fd, res[0], p001, 'p001', 'inner');
	const ress = await nodejs('train-plan/zj-000004/s003', {
		is_stop: 0
	});


	render(fd, ress, p002, 'p002', 'inner');
	set(fd, 'train_number', train_number);
}
